import { getNewsAPI } from '../../api/news';
import { NEWS_SAVE_LIST } from './actionType';

export const getNewsAction = (current) => {
  return async (dispatch) => {
    // 2. dispatch(actin对象)
    const res = await getNewsAPI(current);
    dispatch({ type: NEWS_SAVE_LIST, payload: res.data.results });
  };
};
